﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreFrame.Core.Orm;

namespace MarchEstate.Manager.BusinesEntity
{
    [Serializable]
    [Table(TableName = "WY_OSRCCItemRelation", EntityType = EntityType.Table, IsGB = false)]
    public abstract class AbstractOSRCCItemRelation : CoreFrame.Business.AbstractBusines
    {
        private string _ownerid;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "OwnerId", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string OwnerId
        {
            get { return _ownerid; }
            set { _ownerid = value; }
        }
        private string _srccid;//可以是门面Id、房间ID、停车位Id、客户Id
        /// <summary>
        /// 可以是门面Id、房间ID、停车位Id、客户Id
        /// </summary>
        [Column(FieldName = "SrccId", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string SrccId
        {
            get { return _srccid; }
            set { _srccid = value; }
        }
        private string _itemcode;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "ItemCode", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string ItemCode
        {
            get { return _itemcode; }
            set { _itemcode = value; }
        }
        private string _itemname;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "ItemName", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string ItemName
        {
            get { return _itemname; }
            set { _itemname = value; }
        }
        private int _initFlag;
        /// <summary>
        /// 是否完成默认设置的标识 0 未完成 1已完成 ；完成后就不能再进行初始化设置
        /// </summary>
        [Column(FieldName = "InitFlag", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public int InitFlag
        {
            get { return _initFlag; }
            set { _initFlag = value; }
        }
        private DateTime _lastmaturity;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "Lastmaturity", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public DateTime Lastmaturity
        {
            get { return _lastmaturity; }
            set { _lastmaturity = value; }
        }
        private DateTime _thismaturity;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "Thismaturity", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public DateTime Thismaturity
        {
            get { return _thismaturity; }
            set { _thismaturity = value; }
        }
        private decimal _lastsurplus;//上次收银后的余额，或默认初始化余额
        /// <summary>
        /// 上次收银后的余额，或默认初始化余额
        /// </summary>
        [Column(FieldName = "Lastsurplus", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal Lastsurplus
        {
            get { return _lastsurplus; }
            set { _lastsurplus = value; }
        }
        private decimal _lastlatefee;//上次收银后滞纳金，或默认初始化滞纳金
        /// <summary>
        /// 上次收银后滞纳金，或默认初始化滞纳金
        /// </summary>
        [Column(FieldName = "LastLateFee", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal LastLateFee
        {
            get { return _lastlatefee; }
            set { _lastlatefee = value; }
        }
        private decimal _thiscostfee;//本次收银应收金额，判断是否欠费可以根据此字段
        /// <summary>
        /// 本次收银应收金额，判断是否欠费可以根据此字段
        /// </summary>
        [Column(FieldName = "ThisCostFee", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal ThisCostFee
        {
            get { return _thiscostfee; }
            set { _thiscostfee = value; }
        }
        private decimal _thislatefee;//本次收银欠费产生的滞纳金
        /// <summary>
        /// 本次收银欠费产生的滞纳金
        /// </summary>
        [Column(FieldName = "ThisLateFee", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal ThisLateFee
        {
            get { return _thislatefee; }
            set { _thislatefee = value; }
        }

        private decimal _FavourFee;//优惠金额
        /// <summary>
        /// 优惠金额
        /// </summary>
        [Column(FieldName = "FavourFee", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal FavourFee
        {
            get { return _FavourFee; }
            set { _FavourFee = value; }
        }

        private decimal _RealityFee;//实收金额
        /// <summary>
        /// 实收金额
        /// </summary>
        [Column(FieldName = "RealityFee", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal RealityFee
        {
            get { return _RealityFee; }
            set { _RealityFee = value; }
        }

        private decimal _PrepayFee;//本次余额
        /// <summary>
        /// 本次余额
        /// </summary>
        [Column(FieldName = "PrepayFee", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal PrepayFee
        {
            get { return _PrepayFee; }
            set { _PrepayFee = value; }
        }

        public abstract AbstractOSRCCItemRelation GetSrccItem(string _srccId, string _itemcode);

        /// <summary>
        /// 初始化时候调用
        /// </summary>
        /// <returns></returns>
        public abstract bool UpdateThisFee(string _srccId, string _itemcode, DateTime _Lastmaturity, DateTime _Thismaturity, decimal _Lastsurplus, decimal _LastLateFee);

        /// <summary>
        /// 产生新费用时调用，比如：水费、物业费
        /// </summary>
        /// <returns></returns>
        public abstract bool UpdateThisFee(string _srccId, string _itemcode, DateTime _Thismaturity, decimal _thisCostFee, decimal _thisLateFee);
        /// <summary>
        /// 收银界面的修改用表型费用时调用
        /// </summary>
        /// <returns></returns>
        public abstract bool UpdateThisFee(string _srccId, string _itemcode, decimal _thisCostFee, decimal _thisLateFee, decimal _FavourFee, decimal _RealityFee, decimal _PrepayFee);

        /// <summary>
        /// 收银界面的修改时间型费用时调用
        /// </summary>
        /// <returns></returns>
        public abstract bool UpdateThisFee(string _srccId, string _itemcode, DateTime _Thismaturity, decimal _thisCostFee, decimal _thisLateFee, decimal _FavourFee, decimal _RealityFee, decimal _PrepayFee);

        /// <summary>
        /// 收银之后反写
        /// </summary>
        /// <returns></returns>
        public abstract bool UpdateThisFee(string _srccId, string _itemcode, DateTime _Lastmaturity, DateTime _Thismaturity, decimal _Lastsurplus, decimal _LastLateFee,decimal _thisCostFee, decimal _thisLateFee, decimal _FavourFee, decimal _RealityFee, decimal _PrepayFee);


        /// <summary>
        /// 根据收银对象得到收费项目
        /// </summary>
        /// <param name="_srccId">收银对象ID</param>
        /// <returns></returns>
        public abstract List<AbstractOSRCCItemRelation> GetSrccItemList(string _srccId);

        public abstract bool Delete(string _srccId, string _itemcode);
    }
}
